4D Chart v13

CT Get refnum

Home

 
4D Chart v13
CT Get refnum

CT Get refnum 


 

CT Get refnum ( area ; scope ) -> Function result 
Parameter Type   Description
area  Longint in 4D Chart area
scope  Longint in Scope of the function -2 = Default -1 = All 0 = Selected objects >0 = Object ID
Function result  Longint in Reference number for the objects in area

CT Get refnum returns the reference number for the object(s) in the area described by scope. A reference number is a long integer associated with an object and is not necessarily unique. Reference numbers can only be manipulated programmatically. You assign a reference number to an object. The object ID, on the other hand, is assigned by 4D Chart.

  • If scope equals -2, CT Get refnum returns the default reference number.
  • If scope equals -1, CT Get refnum returns the reference number for all objects in the document. If the reference numbers for the objects are not equal, CT Get refnum returns -32000.
  • If scope equals 0, CT Get refnum returns the reference number for the selected objects. If the reference numbers for the objects are not equal, CT Get refnum returns -32000.
  • If scope is greater than 0, it must be equal to a specific object’s ID and that object’s reference number is returned. If the object does not exist, CT Get refnum returns -32000.

Example  

This example is the object method for a button on a form that contains Area. When the method executes, it checks to see if only one object is selected, searches in the [Parts] table for the corresponding record, and displays its description

 QUERY([Parts];[Parts]RefNum=CT Get refnum(Area;0))
 ALERT("This object is a "+[Parts]Description)

 
PROPERTIES 

Product: 4D Chart
Theme: CT Objects
Number: 14565

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D Chart 1

 
SEE ALSO 

CT Get ID
CT SET REFNUM